<template>
  <!-- 主要内容页-->
  <div class="container">
    <el-container>
      <el-header class="home_header">
        <!-- 页面头部-->
        <div class="home_headerLeft">Vue</div>
        <div class="home_headerRight">2</div>
      </el-header>
      <el-container class="main">
        <!-- 侧边导航 -->
        <el-aside>
        <el-menu
        :default-active="$route.path" router
        class="el-menu-vertical-demo"
        @open="handleOpen"
        @close="handleClose"
        background-color="#545c64"
        text-color="#fff"
        active-text-color="#ffd04b">
        <el-submenu index="1">
          <template slot="title">
            <i class="el-icon-location"></i>
            <span>导航一</span>
          </template>
          <el-menu-item-group>
            <template slot="title">分组一</template>
            <el-menu-item index="1-1">选项1</el-menu-item>
          </el-menu-item-group>
          <el-menu-item-group title="分组2">
            <el-menu-item index="1-3">选项3</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        <el-menu-item index="/page2">
          <i class="el-icon-menu"></i>
          <span slot="title">导航二</span>
        </el-menu-item>
        <el-menu-item index="3" disabled>
          <i class="el-icon-document"></i>
          <span slot="title">导航三</span>
        </el-menu-item>
        <el-menu-item index="/page4" >
          <i class="el-icon-setting"></i>
          <span slot="title">导航四</span>
        </el-menu-item>
        </el-menu>
        </el-aside>
        <!-- 根据侧边导航内容跳转 -->
        <el-main>
          <transition name="fade" mode="out-in">
            <router-view></router-view>
          </transition>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
export default {
  data () {
    return {
    }
  },
  methods: {
    handleOpen (key, keyPath) {
      console.log(key, keyPath)
    },
    handleClose (key, keyPath) {
      console.log(key, keyPath)
    }
  }
}
</script>
<style scoped>
.container{
  position: absolute;
  top:0;
  bottom:0;
  left:0;
  right:0;
  width:100%;
  height: 100%;
}
.el-header{
  background-color: #F59D22;
  color: #333;
  text-align: center;
  line-height: 60px;
}
.el-aside {
  background-color: #D3DCE6;
  color: #333;
  text-align: center;
  width:230px;
}
.el-main {
  background-color: #E9EEF3;
  color: #333;
  text-align: center;
}
.main{
  position: absolute;
  top:60px;
  bottom:0;
  left:0;right: 0;
}
.main aside{
  flex:0 0 230px;
  padding-left:0;
  text-align: left;
  background-color: rgb(84, 92, 100);
}
.main aside .el-menu{
border-right:1px solid rgb(84, 92, 100);
}
.home_header{
  display: flex;
  padding:0;
}
.home_headerLeft{
  flex:0 0 230px;
  color:#fff;
  font-weight: bold;
  text-align: left;font-size:30px;
  padding-left:20px;
  box-sizing: border-box;
  border-right: 1px solid rgb(84, 92, 100);
}
.home_headerRight{
  flex:1;
}
</style>
